set more off

************
*NOTE: Files that are commented contain information that potentially violates confidentiality. To access these files please contact Andrea La Nauze (a.lanauze@uq.edu.au) with a copy of your agreement with Billcap Inc (see README.txt)
************








*************************
*** IMPORTING AND MERGING
*************************

*do doFilesRep/Import_accounts.do // imports account information (panel of offers/plans), identify green 
do doFilesRep/Import_solaraccounts.do // imports solar start date and first date 
*do doFilesRep/Import_inventory.do // imports inventory (panel of products)
*do doFilesRep/Import_invoices.do // imports invoices (panel of cycles)
*do doFilesRep/Import_coded_sales.do // import customer acquisition data coded by sales channel

do doFilesRep/Import_installdata.do // imports postcode level PV penetration
do doFilesRep/Import_locations.do // imports location 
do doFilesRep/Import_censusdata_2011.do // imports census data for 2011
do doFilesRep/Import_censusdata.do // imports census data for 2006 and 2016, combines with 2011
do doFilesRep/Import_moduleprices.do // imports module prices from BNEF
do doFilesRep/Import_quarterlyhousepricedata.do // imports house and unit price data 
do doFilesRep/Import_buildingstructure.do // imports house and unit price data 
do doFilesRep/Import_SA3_bypostcode.do // import SA3 (municipal) postcode match
do doFilesRep/Import_postcode_area.do // import area of postcodes: uncomment first line to transform shape file to .dta 

do doFilesRep/Merge_accounts_inventory.do // merges accounts panel to inventory panel
do doFilesRep/Merge_accounts_PV.do // merges accounts and inventory to solar accounts data and PV penetration data

*** SAMPLES 

*do doFilesRep/Identify_sample.do // identifies valid solar accounts, green accounts to be used for estimation
do doFilesRep/Identify_eventstudysample_since2006.do // codes events, merges other data, collapses to quarterly postcode data
do doFilesRep/Identify_eventstudysample_withsolar.do  // as above, but keeps solar households 
do doFilesRep/Identify_individualwithsolarsample.do // for individual level data 
do doFilesRep/EstimationSample.do  // keeps sample for estimation , i.e. post 2009
do doFilesRep/Merge_sales_estimation.do // merge sales channels with estimation data 
do doFilesRep/Lasso.do // run lasso to pick controls








*************************
*** ANALYSIS
*************************



* TABLES
*********

* paper 
* Table 1 subsidy changes
do doFilesRep/Table2.do 
do doFilesRep/Table3.do 
do doFilesRep/Table4.do 
do doFilesRep/Table5a.do 
do doFilesRep/Table5b.do 

* appendix 
* Table A1 see doFiles/Table2.do 
do doFilesRep/TableA2.do
do doFilesRep/TableA3.do
do doFilesRep/TableA4.do
do doFilesRep/TableA5.do
do doFilesRep/TableA6.do
do doFilesRep/TableA7.do
do doFilesRep/TableA8.do
do doFilesRep/TableA9.do
do doFilesRep/TableA10.do
do doFilesRep/TableA11.do
do doFilesRep/TableA12.do
do doFilesRep/TableA13.do
do doFilesRep/TableA14.do
do doFilesRep/TableA15.do
do doFilesRep/TableA16.do
do doFilesRep/TableA17.do
do doFilesRep/TableA18.do
do doFilesRep/TableA19.do
do doFilesRep/TableA20.do
do doFilesRep/TableA21.do



* FIGURES 
*********

* paper 
do doFilesRep/Figure1a.do 
do doFilesRep/Figure1b.do 
do doFilesRep/Figure2ab.do 
do doFilesRep/Figure2c.do 
do doFilesRep/Figure3.do 
do doFilesRep/Figure6.do 
do doFilesRep/Figure457.do  


* appendix 
* Figure A1 state trends 
do doFilesRep/FigureA2.do 
do doFilesRep/FigureA3.do  
do doFilesRep/FigureA4.do  
do doFilesRep/FigureA5.do  
* Figure A6 images 
do doFilesRep/FigureA7.do  
do doFilesRep/FigureA8.do  
do doFilesRep/FigureA9.do  
do doFilesRep/FigureA10.do  
do doFilesRep/FigureA11.do  
do doFilesRep/FigureA12.do 
do doFilesRep/FigureA13.do 
do doFilesRep/FigureA14.do  
do doFilesRep/FigureA15ab.do  
do doFilesRep/FigureA15cdA16.do 
do doFilesRep/FigureA17.do // NB: uncomment line 6 to run full placebo requires FigureA17_Placebo, FigureA17_TabulatePlot_placebo, FigureA17_Export_placebo_PV
do doFilesRep/FigureA18.do 
do doFilesRep/FigureA19.do 





